package com.example.quedalouca;

import java.util.Map;

import android.content.Context;
import android.util.Log;
import android.view.MotionEvent;

import com.TangoGames.panel.BasePanel;
import com.TangoGames.panel.IPanelEvent;
import com.TangoGames.panel.IPanelState;
import com.TangoGames.panel.IStates;

public class QuedaLoucaGame extends BasePanel {

	/**
	 * TAG
	 */
	private static final String TAG = QuedaLoucaGame.class.getSimpleName();
			
	/**
	 * Construtora
	 * @param context
	 */
	public QuedaLoucaGame(Context context)
	{
		super( context );
		
		this.setCurrentState( StatesQuedaLouca.MENU );
		
	}

	/**
	 * evento de toque na tela, testa com mouse no comp
	 * 
	 * @param event
	 * @return
	 */
	@Override
	public boolean onTouchEvent(MotionEvent event)
	{
		return super.onTouchEvent(event);
	}
	
	/**
	 * 
	 */
	@Override
	public <T extends Enum<T> & IPanelEvent> void handlePanelEvent(IPanelState sourcePanel, T event) {
		//
		QuedaLoucaEvents e = (QuedaLoucaEvents)event;
		//
		switch (e) {
			case MENU_PLAY:
				this.setCurrentState(StatesQuedaLouca.BOX2D);
			break;
			case MUSIC_ON_OFF:
			break;	
		}
	}

	/**
	 * 
	 */
	@Override
	protected void Destroy() {
		
		super.Destroy();
		
        for (Map.Entry<IStates,IPanelState> entry : this.getListOfPanels().entrySet()) {
        	entry.getValue().Destroy();
        }
        
        Log.d(TAG, " Destroy");
	}
	
}
